<template>
  <div id="app">
    <router-view></router-view>
  </div>
</template>

<script>
import { getAllSettingsMap } from "@/http/api";
import { AddWaterMark } from "watermarkerjs";
export default {
  name: "App",
  mounted() {
    this.setSetting();
  },
  methods: {
    async setSetting() {
      let res = await getAllSettingsMap();
      if (res.code === 20041) {
        const watermask = document.querySelector("#watermask");
        if (res.data.watermark) {
          if (watermask) {
            document.body.className = "";
          } else {
            AddWaterMark(JSON.parse(localStorage.getItem("userInfo")));
          }
        } else {
          if (watermask) {
            document.body.className = "hiddenMask";
          }
        }
        document.title = res.data.browser_name_zh;
      }
    },
  },
};
</script>
<style lang="less">
#app {
  padding: 0;
  margin: 0;
  .el-breadcrumb {
    padding-bottom: 24px;
    .el-breadcrumb__inner a {
      font-weight: 700;
      color: #333;
    }
  }
  .reletive {
    position: relative;
  }
  .el-form--inline .el-form-item__label {
    line-height: 10px;
  }
  .search-content,
  .table-content {
    padding: 20px;
    background-color: #fff;
    border-radius: 6px;
  }
  .scroll-content {
    overflow-y: scroll;
    &::-webkit-scrollbar {
      width: 5px;
    }
    &::-webkit-scrollbar-track {
      border-radius: 2px;
    }
    &::-webkit-scrollbar-thumb {
      border-radius: 2px;
      background: #d9d9d9;
    }
  }
  .error-content {
    height: 100vh;
    width: 100vw;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    .details {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      h1 {
        font-size: 20px;
        margin-bottom: 10px;
        font-weight: 500;
      }
      & > span {
        color: rgba(0, 0, 0, 0.45);
        font-size: 14px;
        margin-bottom: 14px;
      }
    }
  }
}
body.hiddenMask {
  #watermask {
    display: none;
  }
}
.auto-avator {
  width: 25px;
  height: 25px;
  font-size: 12px;
  background-color: #4d90f9;
  color: #fff;
  border-radius: 50%;
  text-align: center;
  margin-right: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  &.girl {
    background-color: #fb95d2;
  }
  .name {
    line-height: 26px;
    display: inline-block;
    transform: scale(0.8);
  }
}
</style>
